<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['setting']=$this->plugin_setting('basic');
	$return['list']=array();
	set_html('title','核销台');
	
	$mid = $_SESSION['uid'];
	$saler = pdo_get('jy_weishop_store_worker',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$mid));
	if (empty($saler)) {
		exi('您不是店员，您无核销权限!','error');
	}
	if($saler['roleid']){
		$perms_mobile=pdo_getcolumn('jy_weishop_store_role',array('id'=>$saler['roleid'],'uniacid'=>$_SESSION['uniacid']),'perms_mobile');	
		if($perms_mobile){
			$check=strexists($perms_mobile,';jy_weishop/'.$_RQ['action'].'/;');
			if(!$check && $_RQ['action']!='store.manage.index'){
				exi('你没有该页面权限！请联系管理员开通！','error','jy_weishop/store.manage.index/');
			}
		}
	}
	$member = pdo_get('core_members',array('uniacid'=>$_SESSION['uniacid'],'id'=>$saler['mid']),array('nickname','avatar'));
	$store = false;
	if (!(empty($saler['storeid']))) 
	{
		$store = pdo_get('jy_weishop_store',array('uniacid'=>$_SESSION['uniacid'],'id'=>$saler['storeid']));
	}
	$return['saler']=$saler;
	$return['member']=$member;
	$return['store']=$store;
	exi($return);
}  

	
?>